package com.zjitc;

import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.DataSource;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
      ApplicationContext applicationContext  = new AnnotationConfigApplicationContext(DataSourceConfiguration.class);
      DataSource ds = applicationContext.getBean(DataSource.class);
      try {
        Connection con = ds.getConnection();
        System.out.println(con);
      } catch (SQLException e) {
        e.printStackTrace();
      }

    }
}
